<?php 
/*
$_GET["articleid"];

*/
require("errorhandle.php");

require("phpconnect.php");

$channel= file_get_contents("php://input");

$jsonObjs = json_decode($channel,true);


foreach ($jsonObjs as $jsonObj)
{
    $tmpr = "INSERT INTO channel (pid,channelname,url,corder) VALUES ( " . $jsonObj["pid"] .",'" . $jsonObj["channelname"] ."','" . $jsonObj["url"] . "'," . $jsonObj["corder"] . ") ";
   // echo  $tmpr;   

    $result =mysql_query($tmpr);
	if(!$result)
	{
	    echo "fail";
	    break;
	}
}
echo "sucess";
mysql_close($con);
?>